package IO;

import java.io.*;

public class MyByteCopy {
	private FileInputStream input;
	private FileOutputStream output;
	/**hah
	 * yyaya
	 * */
	private void copyFile(String s1,String s2){
		try {
			input = new FileInputStream(s1);
			
			output = new FileOutputStream(s2);
			int i;
			while((i=input.read())!=-1)
				output.write(i);
			input.close();
			output.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}catch(IOException eIO){
		}
		System.out.println("copy 完毕");
	}
	/**this class 的入口方法
	 * */
	public static void main(String[] args) {
		if(args.length<2){
			System.out.println("需要两个文件名");
			return;
		}
		new MyByteCopy().copyFile(args[0],args[1]);
	}

}
